const dbutil = require('../../../libs/MyDB');

module.exports = {
    getTableInfo: async function (data) {
        let tables = [];
        await dbutil.multiSelect('res_tableinfo', ['table_id', 'table_number', 'table_usage','tabletype_people'],`tabletype_people='${data.type}' and table_usage = '未使用'`)
            .then(
                result => {
                    tables = result;
                }
            )
        return {
            code: 200,
            msg: "查询成功",
            data: tables,
            count: tables.length,
        }
    }
}